package com.ssy.wireless.web.service;

import com.ssy.wireless.entity.ApDevice;
import com.ssy.wireless.entity.ApDeviceOnlineStat;
import com.ssy.wireless.entity.ApDeviceTrafficStat;
import com.ssy.wireless.mapper.ApDeviceMapper;
import com.ssy.wireless.mapper.ApDeviceOnlineStatMapper;
import com.ssy.wireless.mapper.ApDeviceTrafficStatMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
@Service
@Transactional(readOnly = true)
public class ApDeviceService {

    @Autowired
    private ApDeviceMapper apDeviceMapper;

    @Autowired
    private ApDeviceTrafficStatMapper apDeviceTrafficStatMapper;

    @Autowired
    private ApDeviceOnlineStatMapper apDeviceOnlineStatMapper;

    public List<ApDevice> find(Map<String, Object> params) {
        return apDeviceMapper.select(params);
    }

    public List<ApDeviceTrafficStat> findTrafficStatistics(Map<String, Object> params) {
        return apDeviceTrafficStatMapper.selectStatistics(params);
    }

    public List<ApDeviceOnlineStat> findOnlineStatistics(Map<String, Object> params) {
        return apDeviceOnlineStatMapper.selectStatistics(params);
    }
}
